package com.metadata_system.common.db.entity;

import java.util.Date;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Table(name = "md_project_log")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ProjectLog {
    @Id
    private Integer id;

    /**
     * 元数据名称
     */
    @Column(name = "metadata_name")
    private String metadataName;

    /**
     * 元数据ID
     */
    @Column(name = "metadata_id")
    private Integer metadataId;

    /**
     * 项目ID
     */
    @Column(name = "project_id")
    private Integer projectId;

    /**
     * 项目名称
     */
    @Column(name = "project_name")
    private String projectName;

    /**
     * 项目节点名称数组
     */
    @Column(name = "project_node_names")
    private String projectNodeNames;

    /**
     * 用户ID
     */
    @Column(name = "user_id")
    private Integer userId;

    /**
     * 处理用户是否已读
     */
    @Column(name = "is_user_read")
    private Integer isUserRead;

    /**
     * 处理用户ID
     */
    @Column(name = "handler_user_id")
    private Integer handlerUserId;

    /**
     * 处理用户是否已读
     */
    @Column(name = "is_handler_user_read")
    private Integer isHandlerUserRead;

    /**
     * 类型: Import.导入数据 Delete.删除数据
     */
    private String type;

    /**
     * 状态: 0.待处理 1.处理通过 2.处理拒绝
     */
    private Integer status;

    /**
     * 拒绝原因
     */
    @Column(name = "refuse_reason")
    private String refuseReason;


    /**
     * 数据key
     */
    @Column(name = "data_key")
    private String dataKey;

    /**
     * 是否已经锁定: 0.未锁定 1.已锁定
     */
    @Column(name = "is_lock")
    private Integer isLock;

    /**
     * 是否已经回滚: 0.否 1.是
     */
    @Column(name = "is_roll_back")
    private Integer isRollBack;

    /**
     * 相关文件
     */
    private String file;

    /**
     * 处理记录
     */
    @Column(name = "history_total")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Integer historyTotal;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createdTime;
}